# Requires a class with num attribute(which is Numeric) and it's reader

module Compute
  OPERATIONS = [:+, :-, :*, :/]
  
  def method_missing(method, arg=nil)
    if OPERATIONS.include?(method)
      self.class.new(num.send(method, arg.num))
    else
      super
    end
  end
  
  def num_mod(number)
    num.abs.modulo(number)
  end

end